package com.pro.controller;

import com.pro.pojo.JsApplyRecord;
import com.pro.pojo.JsAuditLog;
import com.pro.pojo.JsRole;
import com.pro.pojo.JsonData;
import com.pro.service.JsAuditLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsAuditLogController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2021/11/27 18:11
 * @Author: ZPT
 */
@RestController
@RequestMapping("/auditLog")
public class JsAuditLogController {
    @Autowired
    private JsAuditLogService jsAuditLogService;

    @RequestMapping("/addAuditLog")
    public JsonData addAuditLog(JsAuditLog jsAuditLog){
        Boolean aBoolean = jsAuditLogService.addAuditLog(jsAuditLog);
        return aBoolean!=null?JsonData.buildSuccess(aBoolean):JsonData.buildError("服务端错误");
    }
    @RequestMapping("/getAuditLogUser")
    public JsonData getAuditLogUser(Integer aduitLogType, String position,String account,
                                    String fullName,String applyDate){
        List<JsApplyRecord> list = jsAuditLogService.getAuditLogUser(aduitLogType,position,account,fullName,applyDate);
        return list!=null?JsonData.buildSuccess(list):JsonData.buildError("服务端错误");
    }
}
